import request from "@/utils/request";

//获取项目列表
export function getProjectList(query) {
  return request({
    url: "/project/list",
    method: "get",
    params: query,
  });
}
// 获取字典
export function getDictList() {
  return request({
    url: "/system/dict/extra/all",
    method: "get",
  });
}

// 获取部门树
export function getDeptList() {
  return request({
    url: "/system/dept/extra/tree",
    method: "get",
  });
}

// 获取项目详细信息
export function getProject(id) {
  return request({
    url: "/project/" + id,
    method: "get",
  });
}
// 获取项目详细信息
export function editProject(data) {
  return request({
    url: "/project",
    method: "put",
    data: data,
  });
}

// 新增项目
export function addProject(data) {
  return request({
    url: "/project",
    method: "post",
    data: data,
  });
}
//删除项目
export function deleteProject(id) {
  return request({
    url: "/project/" + id,
    method: "delete",
  });
}

//导出项目
export function exportProject(query) {
  return request({
    url: "/project/export",
    method: "get",
    params: query,
  });
}
//设置分管部门
export function userDept(userId, data) {
  return request({
    url: `/system/user/extra/${userId}/info`,
    method: "post",
    data: data,
  });
}
//导出项目
export function getUserDept(userId) {
  return request({
    url: `/system/user/extra/${userId}/info`,
    method: "get",
  });
}
//导出项目
export function getAllproject() {
  return request({
    url: `/system/dict/extra/project`,
    method: "get",
  });
}
// 批量导入项目
export function importProject(data) {
  return request({
    url: `/project/import`,
    method: "post",
    data: data,
  });
}
